﻿using B.MES.Customer.Application.IApplication;
using B.MES.Customer.Domain;
using B.MES.Customer.Domain.DTO;
using B.MES.Customer.Infrastructure.IRepository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.MES.Customer.Application.Application
{
    /// <summary>
    /// 收入服务实现层
    /// </summary>
    public class IncomeStatementApplication : BaseApplication<IncomeStatement>, IIncomeStatementApplication
    {
        private readonly IIncomeStatementRepository _incomeStatementRepository;
        public IncomeStatementApplication(IIncomeStatementRepository incomeStatementRepository) : base(incomeStatementRepository)
        {
            _incomeStatementRepository = incomeStatementRepository;
        }

        public int AddIncomeState(IncomeStatement incomeStatement)
        {
           var result=_incomeStatementRepository.AddIncomeState(incomeStatement);
            return result;
        }
        public PageApiResut<IncomeStatementDTO> GetIncomeStatement(int PageIndex, int PageSize)
        {
           var result=_incomeStatementRepository.GetIncomeStatement(PageIndex, PageSize);
            return result;
        }

        public List<IncomeType> GetIncomeType()
        {
           var result=_incomeStatementRepository.GetIncomeType();   
            return result;
        }

        public int UpdateIncomeStatement(IncomeStatement incomeStatement)
        {
           var result=_incomeStatementRepository.UpdateIncomeStatement(incomeStatement);    
          return result;
        }
        public APIResult<IncomeStatement> DeleteIncomeStatement(int incomeId)
        {
            var result = _incomeStatementRepository.DeleteIncomeStatement(incomeId);
            return result;
        }

        public APIResult<List<IncomeStatement>> DeletesIncomeStatement(List<IncomeStatement> list)
        {
            var result = _incomeStatementRepository.DeletesIncomeStatement(list);
            return result;
        }

        public IncomeStatement EditIncomeStatement(int incomeId)
        {
            var result = _incomeStatementRepository.EditIncomeStatement(incomeId);
            return result;
        }
    }
}
